﻿using Ndns.Packet.Abstractions;
using System;
using System.Net;
using System.Threading;
using System.Threading.Tasks;

namespace Ndns.Net
{
    public abstract class DnsRequestHandler : IDnsRequestHandler
    {
        public virtual void OnFatalError(IDnsServer server, Exception ex)
        {
            // Do nothing
        }

        public abstract Task<DnsPacket> OnReceivedAsync(IDnsServer server, DnsPacket packet, EndPoint source, CancellationToken cancellationToken);

        public virtual void OnStarted(IDnsServer server)
        {
            // Do nothing
        }

        public virtual void OnStarting(IDnsServer server)
        {
            // Do nothing
        }

        public virtual void OnStopped(IDnsServer server)
        {
            // Do nothing
        }

        public virtual void OnStopping(IDnsServer server)
        {
            // Do nothing
        }
    }
}
